In BPSG or PSG processes, metallic impurities are a serious problem. In the 64M DRAM process, BPSG and PSG are used as a pre-metal dielectric layer (PMD) overlaying the gate, therefore the content of the metallic layer therein is important. For example, if the content of the metallic impurities in the PMD consisting of BPSG is more than 1.times.10.sup.15 .about.2.times.10.sup.16 atoms/cm.sup.3, the PMD overlaying the gate will make leakage current and reduce the functionality of the products.